﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TM.Model;
using TM.Model.Mapper;

namespace TM.Data
{
    public static class MapperFactories
    {
        private static IDictionary<Type, object> Mappers()
        {
            return new Dictionary<Type, object>()
                       {
                           {typeof(Project), new ProjectMapper()},
                           {typeof(ProjectTask), new ProjectTaskMapper()}
                       };

        }

        public static IMapper<T> GetMapper<T>() where T : class
        {

            return (IMapper<T>)Mappers()[typeof(T)];
            
        }
    }
}
